package com.zheng.oa.admin.tags;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zheng.common.util.SpringContextUtil;
import com.zheng.hr.dao.model.HrDict;
import com.zheng.hr.rpc.api.HrDictService;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: xinqi
 * Date: 2018/1/11
 * Time: 17:00
 */
@Component
public class DictTag {
    public static Object getDictList(String key) {
        HrDictService dictService = (HrDictService) SpringContextUtil.getBean("hrDictService");
        EntityWrapper<HrDict> dictEntityWrapper = new EntityWrapper<>();
        dictEntityWrapper.where("key_name='" + key + "'");
        return JSON.toJSON(dictService.selectList(dictEntityWrapper));
        //// TODO: 2018/1/11  完成字典静态工具
    }

}
